//输出基础配置
export default {
    /** 
     * 动画类型 随机取一个
     * 小-大 上一层缩小，新进放大
     * 大-小 上一层放大，新进缩小
     * 向左-下 上一层向左转，新进从底部放大出
     * 向右-下 上一层向右转，新进从底部放大出
     */
    //小-大 上一层缩小，新进放大
    rotateType:{
        //小-大 上一层缩小，新进放大
        A(old,oldlength,newlength){
            if(old == 'A'){

            }
            if(old == 'B'){
                if(newlength==5){
                    return {'transform':'scale(0.5) translate(-51%, -15%)'};
                }
                return {'transform':'scale(0.5) translate(-51%, -15%)'};
            }
            if(old == 'C'){
                if(newlength==5){
                    return {'transform':'scale(0.5) translate(-58%, -14%)'};
                }
                return {'transform':'scale(0.5) translate(-58%, -14%)'};
            }
            if(old == 'D'){
                if(newlength==6){
                    return {'transform':'scale(0.5) translate(65%, -14%)'};
                }
                if(newlength==3 && oldlength==2){
                    return {'transform':'scale(0.5) translate(31%, -14%)'};
                }
            }
            return {};
        },
        //大-小 上一层放大，新进缩小
        B(old,oldlength,newlength){
            if(old == 'A'){
                if(newlength==4){
                    return {'transform':'scale(5) translate(34%, -6%)'};
                }
                return {'transform':'scale(5) translate(34%, -6%)'};
            }
            if(old == 'B'){
                if(oldlength==5){
                    return {'transform':'scale(5) translate(54px, -34px)'};
                }
                return {'transform':'scale(5) translate(54px, -34px)'};
            }
            if(old == 'C'){
            }
            if(old == 'D'){
                if(newlength ==3 && oldlength==2){
                    return {'transform':'scale(5) translate(11%, -6%)'};
                }
            }
            if(old==""){
                if(oldlength==3){
                    return {'transform':'scale(5) translate(15%, -6%)'};
                }
                return {'transform':'scale(5) translate(15%, -6%)'};
            }
        },
        //向左-下 上一层向左转，新进从底部放大出
        C(old,oldlength,newlength){
            if(old == 'A'){
                if(newlength==5){
                    return {'transform':'scale(0.3) rotate(-90deg)  translate(13%, -82%)'};
                }
                if(newlength=2 && oldlength==6){
                    return {'transform':'scale(0.3) rotate(-90deg)  translate(19%, -37%)'};
                }
                return {'transform':'scale(0.3) rotate(-90deg)  translate(13%, -82%)'};
            }
            if(old == 'B'){
            }
            if(old == 'C'){
            }
            if(old == 'D'){
                //大概1em -2% , -5%
                if(newlength==2){
                    return {'transform':'scale(0.3) rotate(-90deg) translate(18%, -38%)'};
                }
                if(newlength==3 && oldlength==2){
                    return {'transform':'scale(0.3) rotate(-90deg) translate(8%, -52%)'};
                }
                if(newlength==3){
                    return {'transform':'scale(0.3) rotate(-90deg) translate(16%, -52%)'};
                }
                if(newlength==4){
                    return {'transform':'scale(0.3) rotate(-90deg) translate(14%, -47%)'};
                }
                if(newlength==5){
                    return {'transform':'scale(0.5) rotate(-90deg) translate(12%, -52%)'};
                }
            }
            if(old==""){
                if(newlength==6){
                    return {'transform':'scale(0.5) rotate(-90deg) translate(7%, -60%)'};
                }
            }
        },
        //向右-下 上一层向右转，新进从底部放大出
        D(old,oldlength,newlength){
            if(old == 'A'){

            }
            if(old == 'B'){
                if(oldlength==6){
                    return {'transform':'rotate(90deg)  translate(41%, -33%)'};
                }
            }
            if(old == 'C'){
                if(newlength==4){
                    return {'transform':'rotate(90deg) translate(33%, -24%)'};
                }
                if(newlength==6){
                    return {'transform':'rotate(90deg) translate(41%, -33%)'};
                }
                if(newlength==2 && oldlength==2){
                    return {'transform':'rotate(90deg) translate(-7%, -15%)'};
                }
                return {'transform':'rotate(90deg) translate(33%, -24%)'};
            }
            if(old == 'D'){
                if(newlength==5){
                    return {'transform':'rotate(90deg) translate(33%, -24%)'};
                }
            }
            return {};
        }
    },
    async getRotateType(notin=''){
        const get = ()=>{
            let index = Math.floor(Object.keys(this.rotateType).length * Math.random());
            return  Object.keys(this.rotateType)[index];
        }
        return new Promise((r)=>{
            let c = get();
            while(notin == c && notin!=''){
                c = get();
            }
            r(this.rotateType[c]);
        })
    },
    //颜色范围 与CSS对应 随机
    textCss:['red','blue','#00FFFF','#FF00FF','#D9D919',
    '#CD7F32',"#E9C2A6",'#7FFF00','#CFB53B','#FF006F','#006FFF',
    '#FF9000','#00FF90'],
    async getTextCss(notin=''){
        const get = ()=>{
            let index = Math.floor(this.textCss.length * Math.random());
            return this.textCss[index];
        }
        return new Promise((r)=>{
            let c = get();
            while(notin == c && notin!=''){
                c = get();
            }
            r(c);
        })
    }
}